function err = calc_error(ypred, y)
    err = 1 - sum(reduce_labels(ypred) == reduce_labels(y)) / size(y, 1);
end

